#include<stdio.h>
#include<math.h>
#define pi 3.141592

void getInput ( double *r , double *s);
void computeResults(double r, double s , double *v , double *a);

int main(){
	double r, s ,v , a;
	
	getInput(&r , &s);
	if (s < r || s<= 0 || r<=0){
		printf("Error : Invalid input");
	} else {
		 computeResults (r , s , &a, &v);
		 printf("\nArea = %.2lf sequare cm", v);
		 printf("\nVolume = %.2lf cubic cm", a);
		 
	}
	
return 0;	
}


//***********//
void getInput ( double *r , double *s){
	 
	 printf("Enter the radius [cm] and the slant length [cm] of the cone: ");
	 scanf("%lf %lf", &*r, &*s);
return; 
}

//*************//
void computeResults (double r, double s , double *v , double *a){
	
		*a = pi*r*(r+s);
	    *v = (pi * r*r * sqrt(s*s - r*r)) / 3;
return;
}
